import request from '@/utils/request'

// 获取-角色列表
export const getRoleListAPI = params => {
  return request.get('/sys/role', { params })
}

// 删除-角色
export const delRoleAPI = id => {
  return request.delete(`/sys/role/${id}`)
}

// 新增-角色
export const addRoleAPI = data => {
  return request.post('/sys/role', data)
}

// 根据 id 获取角色详情, 用于回显
export const getRoleDetailAPI = id => {
  return request.get(`/sys/role/${id}`)
}

// 修改-角色详情
export const updateRoleAPI = data => {
  return request.put(`/sys/role/${data.id}`, data)
}

// 分配-员工-角色
export const assignRolesAPI = data => {
  return request.put('/sys/user/assignRoles', data)
}
